#include #include #include #include #include #include using namespace std; #define ll long long #define endl '\n' const int N=1010; ll n,m; // unordered_set st; vector st; bool used[N]; string input; stack now; void dfs(int cnt){ if(cnt==n){ string nowString; auto t=now; while(t.size()){ nowString+=t.top(); t.pop(); } // st.insert(nowString); st.push_back(nowString); return; } unordered_set sst; for(int i=0;i>n>>input; dfs(0); for(auto t:st)cout<